package com.itheima.sql;

import org.apache.ibatis.annotations.Param;

public class CheckgroupCheckitemSql {
    public String addAllCheckGroupAndCheckItemIds(@Param("groupId") Integer groupId, @Param("checkitemIds") Integer[] checkitemIds) {
        StringBuilder sql = new StringBuilder("insert into t_checkgroup_checkitem values");
        for (Integer checkitemId : checkitemIds) {
                //  更新中间表   检查组和检查项中间表
            sql.append("("+groupId+","+checkitemId+"),");
        }
        sql.deleteCharAt(sql.length()-1);
        return sql.toString();
    }
}
